def isprime(n:int):
    for i in range(2,n):
        if(n%i==0):
            print("NO")
            break
    else:
        print("YES")

if __name__ == '__main__':
    isprime(int(input().strip()))
